using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DoanV1
{
    public partial class F_Dic : Form
    {
        private int flagclick = 0;
        public F_Dic()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Bitmap ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonleftall.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonleft.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonright.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonrightall.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonleftall_off.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonleft_off.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonright_off.png");
            imageList1.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Buttonrightall_off.png");
            imageList1.Images.Add(ListImage);
            
            ListImage = new Bitmap("/Program Files/DoanV1/Images/English_VietNamese.png");//8
            imageList2.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/English_Dictionary.png");//9
            imageList2.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/VietNamese_English.png");//10
            imageList2.Images.Add(ListImage);
            ListImage = new Bitmap("/Program Files/DoanV1/Images/Dictionaryofcomputing.png");//11
            imageList2.Images.Add(ListImage);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Bitmap Inter = new Bitmap("/Program Files/DoanV1/Images/Interface.png");
            Graphics g = this.CreateGraphics();
            g.Clear(Color.White);
            g.DrawImage(Inter, 3, 4);
            //set button left right.....
            g.DrawImage(imageList1.Images[4], 11, 262);
            g.DrawImage(imageList1.Images[5], 28, 262);
            g.DrawImage(imageList1.Images[3], 64, 262);
            g.DrawImage(imageList1.Images[2], 47, 262);//right all
           
            g.Dispose();
            //MessageBox.Show("lfdkfd");
        }

        

        private void F_Dic_MouseDown(object sender, MouseEventArgs e)
        {
            Graphics g = this.CreateGraphics();
            if (MousePosition.X > 208 && MousePosition.X < 228 && MousePosition.Y > 9 && MousePosition.Y<29)
                this.Close();
            if (MousePosition.X > 214 && MousePosition.X < 231 && MousePosition.Y > 36 && MousePosition.Y < 57)
            {
                //button of add new word
                MessageBox.Show("new word");
            }
            if (MousePosition.X > 196 && MousePosition.X < 214 && MousePosition.Y > 36 && MousePosition.Y < 57)
            {
                //combox
                MessageBox.Show("combox");
            }
            if (MousePosition.X > 175 && MousePosition.X < 193 && MousePosition.Y > 36 && MousePosition.Y < 57)
            {
                MessageBox.Show("speaker");
                //speaker
            }
            //click on area get left, leftall, right, rightall
            if (MousePosition.X > 13 && MousePosition.X < 24 && MousePosition.Y > 258 && MousePosition.Y < 268)
            {
                //leftall
                
                g.DrawImage(imageList1.Images[4], 11,262);
                g.DrawImage(imageList1.Images[5], 28, 262);
                g.DrawImage(imageList1.Images[3], 64, 262);
                g.DrawImage(imageList1.Images[2], 47, 262); //rightall available
                flagclick = 0;
               
                
            }

            if (MousePosition.X > 30 && MousePosition.X < 41 && MousePosition.Y > 258 && MousePosition.Y < 268)
            {
                //left
                if (flagclick == 3)
                {
                    
                    g.DrawImage(imageList1.Images[0], 11, 262);//left all
                    g.DrawImage(imageList1.Images[1], 28, 262);//left
                    g.DrawImage(imageList1.Images[3], 64, 262);//right all
                    g.DrawImage(imageList1.Images[2], 47, 262); //rightall available
                    flagclick = flagclick - 1;
                    
                }
                else
                    if (flagclick == 2)
                        flagclick--;
                    else
                        if (flagclick == 1)
                        {
                            
                            g.DrawImage(imageList1.Images[4], 11, 262);
                            g.DrawImage(imageList1.Images[5], 28, 262);
                            g.DrawImage(imageList1.Images[3], 64, 262);
                            g.DrawImage(imageList1.Images[2], 47, 262); //rightall available
                            flagclick--;
                            
                        }
            }
            if (MousePosition.X > 49 && MousePosition.X < 60 && MousePosition.Y > 258 && MousePosition.Y < 268)
            {
                //right
                if (flagclick == 0)
                {
                    //available all button
                    
                    g.DrawImage(imageList1.Images[0], 11, 262);//left all
                    g.DrawImage(imageList1.Images[1], 28, 262);//left
                    g.DrawImage(imageList1.Images[3], 64, 262);//right all
                    g.DrawImage(imageList1.Images[2], 47, 262); //rightall available
                    flagclick = flagclick + 1;
                   
                }
                else
                    if (flagclick == 1)
                    {
                       
                        flagclick++;
                    }
                    else
                        if (flagclick == 2)
                        {
                            
                            g.DrawImage(imageList1.Images[7], 64, 262);
                            g.DrawImage(imageList1.Images[0], 11, 262);
                            g.DrawImage(imageList1.Images[6], 47, 262);
                            g.DrawImage(imageList1.Images[1], 28, 262);//Buttonlef available
                            flagclick++;
                           
                        }
            }
            if (MousePosition.X > 66 && MousePosition.X < 77 && MousePosition.Y > 258 && MousePosition.Y < 268)
            {
                //rightall
                
                g.DrawImage(imageList1.Images[7], 64, 262);
                g.DrawImage(imageList1.Images[0], 11, 262);
                g.DrawImage(imageList1.Images[6], 47, 262);
                g.DrawImage(imageList1.Images[1], 28, 262);//Buttonlef available
                flagclick = 3;
                
               
            }
            //timer1.Enabled = true;
            //int x = MousePosition.X;
            //int y = MousePosition.Y;
            //MessageBox.Show(x + " , " + y);
            
            g.DrawImage(imageList2.Images[flagclick], 79, 258);
            g.Dispose();
                      
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            //press code 
        }

        private void F_Dic_MouseUp(object sender, MouseEventArgs e)
        {
            //timer1.Enabled = false;
        }
    }
}